Dynomotion

Group: DynoMotion Message: 11060 From: dms.davidstevenson Date: 2/11/2015
Subject: Simple DAC Output
Hello All,

I am looking for a simple DAC output device to send +/-10V signals to feed a VFD for spindle speed control.

My system uses KFlop + SnapAmp(s) and I was really hoping not to have to add another large card into the stack. I thought I saw a link to a small card a few months back that looked like it would do the trick, but I can't find the posting.

Thanks for your help,
David.


Group: DynoMotion Message: 11061 From: Tom Kerekes Date: 2/11/2015
Subject: Re: Simple DAC Output
Hi David,

I think others have used something like this:

Regards
TK
 

Group: DynoMotion Message: 11062 From: David Stevenson Date: 2/11/2015
Subject: Re: Simple DAC Output
Hi Tom,

Thank you... I think that looks familiar. Is it appropriate for my DynoMotion system?

Best regards,
David.

On 2/11/2015 11:31 AM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

I think others have used something like this:

Regards
TK
 

Group: DynoMotion Message: 11277 From: David Stevenson Date: 3/28/2015
Subject: Re: Simple DAC Output
Hi Tom,

Is it possible to use the KFlop JP5 connector to send S/D signals to this card? My system has 2 SnapAmps, but runs 2 brushless servo and 2 stepper motors already.

Thanks,
David.

On 2/11/2015 11:31 AM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

I think others have used something like this:

Regards
TK
 

Group: DynoMotion Message: 11278 From: Tom Kerekes Date: 3/28/2015
Subject: Re: Simple DAC Output
Hi David,

Yes. KFLOP has Step/Dir Generators 4-7 available.

Regards
TK

Group: DynoMotion Message: 11279 From: David Stevenson Date: 3/28/2015
Subject: Re: Simple DAC Output
Thanks Tom. I'll give it a try.

Regards,
David.

On 3/28/2015 12:04 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes. KFLOP has Step/Dir Generators 4-7 available.

Regards
TK

Group: DynoMotion Message: 11486 From: David Stevenson Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi Tom,

Could I bother you for some guidance on how I configure one of these S/D generators in my c code? Presently have defined X,Y,Z and A axis for the other servos and steppers.

Thanks in advance,
David.

On 3/28/2015 12:04 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes. KFLOP has Step/Dir Generators 4-7 available.

Regards
TK

Group: DynoMotion Message: 11487 From: Tom Kerekes Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi David,

The first step would be to pick an unused KFLOP Axis channel (#4?) to use and configure it for Step Dir and enable it.   A Step signal is available on KFLOP JP5 Pin1.  You would also need a KFLOP GND.  The C6 board should work with TTL mode so for S/D Generator #4 in TTL Mode set the Output Channel0 to 4+8=12.  You should then be able to Jog4=xxxx to get some analog voltage out of the C6 which in turn will control the Spindle Speed.

Let me know how much of this you understand.

Regards
TK

Group: DynoMotion Message: 11489 From: David Stevenson Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi Tom,

Thanks for your reply.

I understand using axis 4, because 0 through 3 are used for the other motors. Can I configure this axis on the KMotion screen and copy/paste the exported code to my init file? I've never used S/D yet ( I think... LOL) so I will do some reading on that, but I will set the output0 to 12 and give it a try.

Thanks again,
David.

On 5/8/2015 3:49 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

The first step would be to pick an unused KFLOP Axis channel (#4?) to use and configure it for Step Dir and enable it.   A Step signal is available on KFLOP JP5 Pin1.  You would also need a KFLOP GND.  The C6 board should work with TTL mode so for S/D Generator #4 in TTL Mode set the Output Channel0 to 4+8=12.  You should then be able to Jog4=xxxx to get some analog voltage out of the C6 which in turn will control the Spindle Speed.

Let me know how much of this you understand.

Regards
TK

Group: DynoMotion Message: 11491 From: Tom Kerekes Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 1:33 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Thanks for your reply.

I understand using axis 4, because 0 through 3 are used for the other motors. Can I configure this axis on the KMotion screen and copy/paste the exported code to my init file? I've never used S/D yet ( I think... LOL) so I will do some reading on that, but I will set the output0 to 12 and give it a try.

Thanks again,
David.



On 5/8/2015 3:49 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

The first step would be to pick an unused KFLOP Axis channel (#4?) to use and configure it for Step Dir and enable it.   A Step signal is available on KFLOP JP5 Pin1.  You would also need a KFLOP GND.  The C6 board should work with TTL mode so for S/D Generator #4 in TTL Mode set the Output Channel0 to 4+8=12.  You should then be able to Jog4=xxxx to get some analog voltage out of the C6 which in turn will control the Spindle Speed.

Let me know how much of this you understand.

Regards
TK

Group: DynoMotion Message: 11493 From: David Stevenson Date: 5/8/2015
Subject: Re: Simple DAC Output
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.

On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 1:33 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Thanks for your reply.

I understand using axis 4, because 0 through 3 are used for the other motors. Can I configure this axis on the KMotion screen and copy/paste the exported code to my init file? I've never used S/D yet ( I think... LOL) so I will do some reading on that, but I will set the output0 to 12 and give it a try.

Thanks again,
David.



On 5/8/2015 3:49 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

The first step would be to pick an unused KFLOP Axis channel (#4?) to use and configure it for Step Dir and enable it.   A Step signal is available on KFLOP JP5 Pin1.  You would also need a KFLOP GND.  The C6 board should work with TTL mode so for S/D Generator #4 in TTL Mode set the Output Channel0 to 4+8=12.  You should then be able to Jog4=xxxx to get some analog voltage out of the C6 which in turn will control the Spindle Speed.

Let me know how much of this you understand.

Regards
TK

Group: DynoMotion Message: 11494 From: Tom Kerekes Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11495 From: David Stevenson Date: 5/8/2015
Subject: Re: Simple DAC Output
Hi Tom,

Thank you. That sounds great!

I'll let you know how I make out.

Best regards and have a good weekend,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11498 From: David Stevenson Date: 5/9/2015
Subject: Re: Simple DAC Output
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11499 From: TK Date: 5/9/2015
Subject: Re: Simple DAC Output
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11500 From: David Stevenson Date: 5/9/2015
Subject: Re: Simple DAC Output
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11501 From: TK Date: 5/9/2015
Subject: Re: Simple DAC Output
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11502 From: David Stevenson Date: 5/9/2015
Subject: Re: Simple DAC Output
Hi Tom,

Setting the FPGA to 63+0x80 did the trick. Now I will work to get the coding setup in KMotionCNC.

Thanks for your help,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11558 From: David Stevenson Date: 5/24/2015
Subject: Re: Simple DAC Output
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.

On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11560 From: Tom Kerekes Date: 5/24/2015
Subject: Re: Simple DAC Output
Hi David,

Before running GCode or creating Spindle Programs the first step would be to just verify that you can generate some step pulses that create some analog voltage and that make the spindle move.

The only think you might need some C code for is a line of code to set the Step Pulse Length and Polarity as we previously discussed.

Have you done this?  Use the KMotion.exe screens to configure the axis and the Step Response and Console Screens to verify functionality.

BTW there is a DefineCoordSystem6 function for defining more than 4 GCode Axes.  But the Spindle is not part of the coordinated motion axes so you would not need this.

Regards
TK 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, May 24, 2015 1:51 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.



On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11562 From: David Stevenson Date: 5/24/2015
Subject: Re: Simple DAC Output
Hi Tom,

After I sent the previous note, it occurred to me to use the step response to create a signal, which I did, and the move generated the expected analog voltage on the C6.

I did modify the pulse length as you explained previously.

It seems to me that maybe I'm not using an appropriate combo of files for the M3 M5 and S commands. I will explore them some more and try to properly understand what they each do.

Thank you,
David.

On 5/24/2015 5:11 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Before running GCode or creating Spindle Programs the first step would be to just verify that you can generate some step pulses that create some analog voltage and that make the spindle move.

The only think you might need some C code for is a line of code to set the Step Pulse Length and Polarity as we previously discussed.

Have you done this?  Use the KMotion.exe screens to configure the axis and the Step Response and Console Screens to verify functionality.

BTW there is a DefineCoordSystem6 function for defining more than 4 GCode Axes.  But the Spindle is not part of the coordinated motion axes so you would not need this.

Regards
TK 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, May 24, 2015 1:51 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.



On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11563 From: TK Date: 5/24/2015
Subject: Re: Simple DAC Output
Hi David,

You might refer to this:

Regards 
TK

On May 24, 2015, at 3:31 PM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

After I sent the previous note, it occurred to me to use the step response to create a signal, which I did, and the move generated the expected analog voltage on the C6.

I did modify the pulse length as you explained previously.

It seems to me that maybe I'm not using an appropriate combo of files for the M3 M5 and S commands. I will explore them some more and try to properly understand what they each do.

Thank you,
David.

On 5/24/2015 5:11 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Before running GCode or creating Spindle Programs the first step would be to just verify that you can generate some step pulses that create some analog voltage and that make the spindle move.

The only think you might need some C code for is a line of code to set the Step Pulse Length and Polarity as we previously discussed.

Have you done this?  Use the KMotion.exe screens to configure the axis and the Step Response and Console Screens to verify functionality.

BTW there is a DefineCoordSystem6 function for defining more than 4 GCode Axes.  But the Spindle is not part of the coordinated motion axes so you would not need this.

Regards
TK 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, May 24, 2015 1:51 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.



On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11564 From: David Stevenson Date: 5/24/2015
Subject: Re: Simple DAC Output
Thanks Tom,

I referred to that help file previously, but I think I need to read through it again. I was planning to use JP5 bits 38 and 41 to enable and run the spindle via the 2 relays on the C6. Is it possible to use the bits for the M3 and M5 (I don't need CCW) and pass a speed variable via a c program without using the c programs for M3/M5?

Best regards,
David.

On 5/24/2015 6:40 PM, TK tk@... [DynoMotion] wrote:
 
Hi David,

You might refer to this:

Regards 
TK

On May 24, 2015, at 3:31 PM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

After I sent the previous note, it occurred to me to use the step response to create a signal, which I did, and the move generated the expected analog voltage on the C6.

I did modify the pulse length as you explained previously.

It seems to me that maybe I'm not using an appropriate combo of files for the M3 M5 and S commands. I will explore them some more and try to properly understand what they each do.

Thank you,
David.

On 5/24/2015 5:11 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Before running GCode or creating Spindle Programs the first step would be to just verify that you can generate some step pulses that create some analog voltage and that make the spindle move.

The only think you might need some C code for is a line of code to set the Step Pulse Length and Polarity as we previously discussed.

Have you done this?  Use the KMotion.exe screens to configure the axis and the Step Response and Console Screens to verify functionality.

BTW there is a DefineCoordSystem6 function for defining more than 4 GCode Axes.  But the Spindle is not part of the coordinated motion axes so you would not need this.

Regards
TK 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, May 24, 2015 1:51 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.



On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11567 From: David Stevenson Date: 5/25/2015
Subject: Re: Simple DAC Output
Hi Tom,

I went through the help file again and the only thing I could find that was out of place was I was missing the VAR value of 113 on the "S" configuration line of KMotionCNC config screen.

There is some still some issue conveying the speed value. I'm not sure if it's a frequency issue (C6 says 50KHz max), pulse length or some conversion of both along the way. Using the console screen with jog commands seems to produce the desired results, but I can't seem to get it going in KMotionCNC.

Any suggestions would be greatly appreciated.

Best regards,
David.

On 5/24/2015 6:40 PM, TK tk@... [DynoMotion] wrote:
 
Hi David,

You might refer to this:

Regards 
TK

On May 24, 2015, at 3:31 PM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Tom,

After I sent the previous note, it occurred to me to use the step response to create a signal, which I did, and the move generated the expected analog voltage on the C6.

I did modify the pulse length as you explained previously.

It seems to me that maybe I'm not using an appropriate combo of files for the M3 M5 and S commands. I will explore them some more and try to properly understand what they each do.

Thank you,
David.

On 5/24/2015 5:11 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Before running GCode or creating Spindle Programs the first step would be to just verify that you can generate some step pulses that create some analog voltage and that make the spindle move.

The only think you might need some C code for is a line of code to set the Step Pulse Length and Polarity as we previously discussed.

Have you done this?  Use the KMotion.exe screens to configure the axis and the Step Response and Console Screens to verify functionality.

BTW there is a DefineCoordSystem6 function for defining more than 4 GCode Axes.  But the Spindle is not part of the coordinated motion axes so you would not need this.

Regards
TK 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Sunday, May 24, 2015 1:51 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Hi Tom,

Me again. Just getting back to setting this up, but I'm not sure the axis is defined properly to produce the output. In the init file I included the cut/paste info from the config screen and then I tried to include this 5th axis in the define coord system line from the init file DefineCoordSystem(1,0,2,3); as axis 4, I get a compile error for the init file.

As it stands, I'm not getting any analog voltage on the C6. Is there a persist value for the speed within the system without me entering a value? I tried using the send box in KMotionCNC with an "S1000" value, but it didn't seem to make any difference.

I have setup the KMotionCNC screen to use the files "SpindleOnCWJog.c, SpindleOffJog.c and SpindleJog.c for the "S" command.

Would you have any suggestions for other things to check?

Thanks in advance,
David.



On 5/9/2015 12:26 PM, TK tk@... [DynoMotion] wrote:
 
Yes

TK

On May 9, 2015, at 9:04 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Thanks Tom,

Can I add the FPGA code line to the init file?

Best regards,
David.

On 5/9/2015 11:45 AM, TK tk@... [DynoMotion] wrote:
 
Hi David,

Open Collector will not drive high at all (it only drives low) so I wouldn't expect it to work at all. 

Yes set the pulse width to max 63 and try both polarities. See how to set the FPGA register here:
TK

On May 9, 2015, at 7:48 AM, David Stevenson david.m.stevenson@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 
Hi Tom,

I'm not having any success with this yet.

There are a couple of things I noticed... the input specs for the C6 show it is optocoupler with on state active high. Would not the output channel0=4 be a more appropriate setting? My interpretation of this is the output would be open collector which seems more appropriate for the C6. The other thing is it seems to need a min pulse width of 3uS and KFlop is 2uS (I think). I am currently trying to figure out how to change the FPGA to increase the pulse width.

Does this make sense to you?

Thanks for your help,
David.

On 5/8/2015 5:58 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

You would just command a continuous Jog command (for example console command Jog4=10000).  Once you have a spindle that is controllable using Jogs then we have four User C programs that will issue the appropriate commands.  See:

Regards
TK

 


From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Friday, May 8, 2015 2:42 PM
Subject: Re: [DynoMotion] Simple DAC Output

 
Thanks Tom,

Once the system is setup and coded, how would one issue a command to keep feeding signals to it (keep the spindle going)? Can it be linked to an "S" command?

Best regards,
David.



On 5/8/2015 4:39 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Yes you can do everything with the KMotion Screens to configure and test functionality.  Then after it is working automatically convert to C Code and paste into your initialization C Program with your other axes.

Regards
TK

Group: DynoMotion Message: 11568 From: Tom Kerekes Date: 5/25/2015
Subject: Re: Simple DAC Output
Hi David,

Show us how you have M3,M5, and S configured in KMotionCNC Tool Setup and post the C files you are using with any included files.

Also inform us of the Spindle Axis you are using and how it is configured.

Regards
TK
 

Group: DynoMotion Message: 11569 From: David Stevenson Date: 5/25/2015
Subject: Re: Simple DAC Output
Hi Tom,

Here is the config stuff...




here is the ONCWJog.c file...

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[SPEEDVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    if (LastState==-1) 
    {
        // if spindle was CCW now we want CW
        // spin down
       
        ClearBit(SPINDLECW_BIT);
        ClearBit(SPINDLECCW_BIT);
        Jog(SPINDLEAXIS,0);
        while (!CheckDone(SPINDLEAXIS)) ;
    }
   
    // turn spindle on CW and ramp to new speed
    SetBit(SPINDLECW_BIT);
    SetBit(41);                // spindle enabling bit
   
    if (*css_mode != 2)
    {
        // spindle is already on, so ramp to new speed
        if (USE_POS_NEG_VOLTAGE)
            Jog(SPINDLEAXIS,speed * FACTOR * LastState);
        else
            Jog(SPINDLEAXIS,speed * FACTOR);
        printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
    }
    persist.UserData[STATEVAR] = 1;  // remember we are CW
}

Here is the OFFJog.c ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"


// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    // spin down
   
    ClearBit(SPINDLECW_BIT);
    ClearBit(SPINDLECCW_BIT);
    ClearBit(41);                        // spindle enabling bit
    Jog(SPINDLEAXIS,0);
    printf("Jogging Spindle Stop\n");
    persist.UserData[STATEVAR] = 0;      // remember we are Off
    while (!CheckDone(SPINDLEAXIS)) ;
}

Here is the SpindleJog.c file ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed
   
    if (LastState==0 || *css_mode == 2) 
    {
        // if spindle is off (or CSS mode) and User Changes the speed
        // just save the desired speed
       
        return 0;
    }
   
    // spindle is already on, so ramp to new speed
    if (USE_POS_NEG_VOLTAGE)
        Jog(SPINDLEAXIS,speed * FACTOR * LastState);
    else
        Jog(SPINDLEAXIS,speed * FACTOR);
       
    printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
}

and here is the MySpindleDefs.h file ...

#define SPINDLEAXIS 4            // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0)      // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 38           // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation
#define SPEEDVAR 99                // global persistant variable to store latest speed
#define STATEVAR 98                // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define PC_COMM_CSS_S 113         // S speed setting in inches/sec
#define KMVAR PC_COMM_CSS_S     // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 0     // 0 = output Magnitude, 1 = output positive and negative speed

Sorry about the wicked format!!!!

Thanks,
David.

On 5/25/2015 2:51 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Show us how you have M3,M5, and S configured in KMotionCNC Tool Setup and post the C files you are using with any included files.

Also inform us of the Spindle Axis you are using and how it is configured.

Regards
TK
 

Group: DynoMotion Message: 11570 From: Tom Kerekes Date: 5/25/2015
Subject: Re: Simple DAC Output [1 Attachment]
Attachments :
Hi David,

Thanks those look reasonable to me.  Except you might have configured MySpindleDef.h for your enable bit rather than coding it in.  Will driving bits 38 and 155 cause any problem? 

Also inform us of the Spindle Axis you are using and how it is configured and enabled.

When entering M3 and Sxxxx in KMotionCNC MDI what is printed on the Console Screen and what happens?

Regards,
TK




From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Monday, May 25, 2015 12:47 PM
Subject: Re: [DynoMotion] Simple DAC Output [1 Attachment]

 
[Attachment(s) from David Stevenson included below]
Hi Tom,

Here is the config stuff...

alt


here is the ONCWJog.c file...

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[SPEEDVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    if (LastState==-1) 
    {
        // if spindle was CCW now we want CW
        // spin down
       
        ClearBit(SPINDLECW_BIT);
        ClearBit(SPINDLECCW_BIT);
        Jog(SPINDLEAXIS,0);
        while (!CheckDone(SPINDLEAXIS)) ;
    }
   
    // turn spindle on CW and ramp to new speed
    SetBit(SPINDLECW_BIT);
    SetBit(41);                // spindle enabling bit
   
    if (*css_mode != 2)
    {
        // spindle is already on, so ramp to new speed
        if (USE_POS_NEG_VOLTAGE)
            Jog(SPINDLEAXIS,speed * FACTOR * LastState);
        else
            Jog(SPINDLEAXIS,speed * FACTOR);
        printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
    }
    persist.UserData[STATEVAR] = 1;  // remember we are CW
}

Here is the OFFJog.c ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"


// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    // spin down
   
    ClearBit(SPINDLECW_BIT);
    ClearBit(SPINDLECCW_BIT);
    ClearBit(41);                        // spindle enabling bit
    Jog(SPINDLEAXIS,0);
    printf("Jogging Spindle Stop\n");
    persist.UserData[STATEVAR] = 0;      // remember we are Off
    while (!CheckDone(SPINDLEAXIS)) ;
}

Here is the SpindleJog.c file ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed
   
    if (LastState==0 || *css_mode == 2) 
    {
        // if spindle is off (or CSS mode) and User Changes the speed
        // just save the desired speed
       
        return 0;
    }
   
    // spindle is already on, so ramp to new speed
    if (USE_POS_NEG_VOLTAGE)
        Jog(SPINDLEAXIS,speed * FACTOR * LastState);
    else
        Jog(SPINDLEAXIS,speed * FACTOR);
       
    printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
}

and here is the MySpindleDefs.h file ...

#define SPINDLEAXIS 4            // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0)      // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 38           // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation
#define SPEEDVAR 99                // global persistant variable to store latest speed
#define STATEVAR 98                // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define PC_COMM_CSS_S 113         // S speed setting in inches/sec
#define KMVAR PC_COMM_CSS_S     // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 0     // 0 = output Magnitude, 1 = output positive and negative speed

Sorry about the wicked format!!!!

Thanks,
David.



On 5/25/2015 2:51 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Show us how you have M3,M5, and S configured in KMotionCNC Tool Setup and post the C files you are using with any included files.

Also inform us of the Spindle Axis you are using and how it is configured.

Regards
TK
 

Group: DynoMotion Message: 11571 From: David Stevenson Date: 5/25/2015
Subject: Re: Simple DAC Output [1 Attachment]
Hi Tom,

I think I found the problem. There were 2 copies of the MySpindleDefs.h in a couple of different places and one of them had the spindle axis as #6, while it is setup as #4 on my system. I changed it to #4 and away it went. Where is the appropriate place for the header file in this case?

Why do you ask about driving bits 38 and 155 causing problems? Is there something I need to watch out for?

Thanks for your help,
David.

On 5/25/2015 4:05 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Thanks those look reasonable to me.  Except you might have configured MySpindleDef.h for your enable bit rather than coding it in.  Will driving bits 38 and 155 cause any problem? 

Also inform us of the Spindle Axis you are using and how it is configured and enabled.

When entering M3 and Sxxxx in KMotionCNC MDI what is printed on the Console Screen and what happens?

Regards,
TK




From: "David Stevenson david.m.stevenson@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Monday, May 25, 2015 12:47 PM
Subject: Re: [DynoMotion] Simple DAC Output [1 Attachment]

 
[Attachment(s) from David Stevenson included below]
Hi Tom,

Here is the config stuff...

alt


here is the ONCWJog.c file...

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[SPEEDVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    if (LastState==-1) 
    {
        // if spindle was CCW now we want CW
        // spin down
       
        ClearBit(SPINDLECW_BIT);
        ClearBit(SPINDLECCW_BIT);
        Jog(SPINDLEAXIS,0);
        while (!CheckDone(SPINDLEAXIS)) ;
    }
   
    // turn spindle on CW and ramp to new speed
    SetBit(SPINDLECW_BIT);
    SetBit(41);                // spindle enabling bit
   
    if (*css_mode != 2)
    {
        // spindle is already on, so ramp to new speed
        if (USE_POS_NEG_VOLTAGE)
            Jog(SPINDLEAXIS,speed * FACTOR * LastState);
        else
            Jog(SPINDLEAXIS,speed * FACTOR);
        printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
    }
    persist.UserData[STATEVAR] = 1;  // remember we are CW
}

Here is the OFFJog.c ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"


// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    // spin down
   
    ClearBit(SPINDLECW_BIT);
    ClearBit(SPINDLECCW_BIT);
    ClearBit(41);                        // spindle enabling bit
    Jog(SPINDLEAXIS,0);
    printf("Jogging Spindle Stop\n");
    persist.UserData[STATEVAR] = 0;      // remember we are Off
    while (!CheckDone(SPINDLEAXIS)) ;
}

Here is the SpindleJog.c file ...

#include "KMotionDef.h"

#include "MySpindleDefs.h"

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];            // Mode 1=Normal RPM mode. 2=CSS

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
    float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float
    float LastState = persist.UserData[STATEVAR];  // get last state
   
    persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed
   
    if (LastState==0 || *css_mode == 2) 
    {
        // if spindle is off (or CSS mode) and User Changes the speed
        // just save the desired speed
       
        return 0;
    }
   
    // spindle is already on, so ramp to new speed
    if (USE_POS_NEG_VOLTAGE)
        Jog(SPINDLEAXIS,speed * FACTOR * LastState);
    else
        Jog(SPINDLEAXIS,speed * FACTOR);
       
    printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
}

and here is the MySpindleDefs.h file ...

#define SPINDLEAXIS 4            // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0)      // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 38           // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation
#define SPEEDVAR 99                // global persistant variable to store latest speed
#define STATEVAR 98                // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define PC_COMM_CSS_S 113         // S speed setting in inches/sec
#define KMVAR PC_COMM_CSS_S     // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 0     // 0 = output Magnitude, 1 = output positive and negative speed

Sorry about the wicked format!!!!

Thanks,
David.



On 5/25/2015 2:51 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Show us how you have M3,M5, and S configured in KMotionCNC Tool Setup and post the C files you are using with any included files.

Also inform us of the Spindle Axis you are using and how it is configured.

Regards
TK
 

Group: DynoMotion Message: 11572 From: Tom Kerekes Date: 5/25/2015
Subject: Re: Simple DAC Output
Hi David,

Great that you figured it out.  Any included file should be in the same directory as the files that include it.

Your MySpindleDefs.h has these defines:

#define SPINDLECW_BIT 38           // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

So for example this code is switching them off as well as the 41 that I believe you added.   Instead of adding your own code change the defines to what you need.  If you don't have a CCW bit then set the bit to something that isn't used.

    ClearBit(SPINDLECW_BIT);
    ClearBit(SPINDLECCW_BIT);
    ClearBit(41);                        // spindle enabling bit

Regards
TK



Group: DynoMotion Message: 11573 From: David Stevenson Date: 5/25/2015
Subject: Re: Simple DAC Output
Hi Tom,

Thanks for that information.

Because I don't have a 100% understanding of how the various bits and programs are interlinked and structured, I feel safer leaving the things alone that are there and adding other things which I know are applicable. Hope that makes sense. I worry that if I change something to suit my need, that it may impact something else which I didn't  even know was related. With each of these challenges that come along the understanding does increase. I really appreciate your help and patience during this growth.

Best regards,
David.

On 5/25/2015 6:17 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi David,

Great that you figured it out.  Any included file should be in the same directory as the files that include it.

Your MySpindleDefs.h has these defines:

#define SPINDLECW_BIT 38           // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

So for example this code is switching them off as well as the 41 that I believe you added.   Instead of adding your own code change the defines to what you need.  If you don't have a CCW bit then set the bit to something that isn't used.

    ClearBit(SPINDLECW_BIT);
    ClearBit(SPINDLECCW_BIT);
    ClearBit(41);                        // spindle enabling bit

Regards
TK